<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib  prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
	function dosubmit() {
		if (document.all("name").value == "") {
			alert("用户名不能为空");
			document.all("name").focus();
			return false;
		}
		if (document.all("password").value == "") {
			alert("密码不能为空");
			document.all("password").focus();
			return false;
		}

		return true;
	}
</script>
<script type="text/javascript">
	function dosubmit() {

		if (!confirm("确定要删除吗？")) {
			return false;
		}
		return true;
	}
</script>
</head>
<%
	//获取项目绝对路径 如： http://ip:port/projectName/
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<body>
	<h1>用户列表</h1>
	
	<table width="96%" border="1" >
			<s:if test="studentList!=null && studentList.size()>0">

				<tr bordercolor="#22f09">
					<td width="5%" align="center">序号</td>
					<td width="20%" align="center">姓名</td>
					<td width="10%" align="center">性别</td>
					<td width="10%" align="center">年龄</td>
					<td width="20%" align="center">地址</td>
					<td width="20%" align="center">电话</td>
					<td width="15%" align="center" colspan="2">操 作</td>
				</tr>
				<!-- 迭代输出List里面的数据 -->
				<s:iterator value="studentList" status="webindex">
					<tr >
						<td><s:property value="#webindex.index+1" /></td>
						<td align="center"><s:property value="name" /></td>
						<td align="center"><s:property value="sex" /></td>
						<td align="center"><s:property value="age" /></td>
						<td align="center"><s:property value="address" /></td>
						<td align="center"><s:property value="number" /></td>
						<td align="center"><a
							href="<%=basePath%>/manage/edit.action?_id=<s:property value="_id" />">编 辑</a></td>
						<td align="center"><a
							href="<%=basePath%>/manage/del.action?_id=<s:property value="_id" />" onclick="return dosubmit();">删 除</a></td>
					</tr>
				</s:iterator>


			</s:if>
			<s:else>
				<br>
				<span >学生信息为空。</span>
				<br>
			</s:else>
			<tr >
				<td colspan="8" align="right"><a href="<%=basePath%>/manage/add.action"  >新&nbsp;&nbsp;&nbsp;&nbsp;增</a></td>
			</tr>
		</table>
	
	
	
</body>
</html>